#include <stdio.h>

#include "user_socket.h"
#include "network_socket.h"
#include "wasApp.h"








/**
 * @brief  获取室内机设备的ip
 * @date   2023-10-23 10:58:14
 * @author xiaole
 * @param  p_ip
 * @param  b 栋
 * @param  f 层
 * @param  d 房号
 * @note
 */
#define DEVICE_INDOOR_IP_GET(p_ip, b, f, d) \
    do { \
        if ((0 <= b && b <= 255) && (0 <= f && f <= 255) && (0 <= d && d <= 255)) { \
            snprintf(p_ip, 32, "100.%d.%d.%d", b, f, d); \
        } else { \
            strncpy(p_ip, "Invalid IP address", 32); \
        } \
    } while (0)


 /**
  * @brief  获取设备标识
  * @date   2023-10-23 15:55:43
  * @author xiaole
  * @param  base [100]-门铃
  * @param  base [101]-二次确认机
  * @param  base [102]-ipc
  * @note
  */

#define DEVICE_INDOOR_INDEX_GET(base,b, f, d)   (base&0xFF)<<24|(b&0xFF)<<16|(f&0xFF)<<8|(d&0xFF)

  /*
  100. 栋.  层.门
  100.001.001.11  11101
  100.002.002.12  22102
  0x FF FF FF FF

  route del -net 224.0.0.0 netmask 240.0.0.0 dev br0
  route add -net 224.0.0.0 netmask 240.0.0.0 dev br0


  /mnt/share/work/Ryan/2wire-common-project/ANYKA37E.BIN

   */




/**
 * @brief
 * @date   2023-10-19 20:00:21
 * @author xiaole
 * @param  argv
 * @param  argc [1]-type [2]base [3]build [4]-floor [5]-index
 * @return int
 * @note
 */
int main(int argv, char **argc){
    LOG_WHITE(" ####### argv:%d, argc[0]:%s, argc[1]:%s ####### \n", argv, argc[0], argc[1]);


    _network_device_init();

    while(1);
}

